#ifndef HANDWIDGET_H
#define HANDWIDGET_H

#include <QWidget>
#include "handtopbtn.h"
#include <QMap>
#include <QDebug>
#include <QSqlQuery>
#include <QTimer>

//手动界面
namespace Ui {
class HandWidget;
}

class HandWidget : public QWidget
{
    Q_OBJECT

public:
    explicit HandWidget(QWidget *parent = nullptr);
    ~HandWidget();

    void init();

    void db_init();

    bool db_select();

    bool db_update_time();

    bool eventFilter(QObject *watched, QEvent *event);
signals:
    void label_push();
    void label_2_push();
    void label_3_push();
    void label_4_push();
    void label_5_push();
    void label_6_push();
    void label_7_push(int m_ill);
    void label_17_push(int m_ill);
    void label_18_push(float m_tm);
    void label_21_push(float m_tm);
    void label_22_push(int m_hm);
    void label_23_push(int m_hm);

private:
    Ui::HandWidget *ui;
    QMap<QString,HandTopBtn*> m_HandBtnMap;//手动导航按钮
    //预警值
    float m_tm;
    int m_hm;
    int m_ill;

public:
    QTimer m_Timer;
    //当前值
    float n_tm = 0.0;
    int n_hm = 0;
    int n_ill =0;
    //有效时间
    int tm_time = 0;
    int hm_time = 0;
    int ill_time = 0;
};

#endif // HANDWIDGET_H
